/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package net.etfbl.dao.base;

import java.io.Serializable;
import java.sql.ResultSet;
import java.util.List;

/**
 *
 * @author abosancic
 */
public interface IDAOBase<T, PK extends Serializable> {

    T find(PK id);

    List<T> findAll();

    boolean remove(PK id);

    boolean remove(T t);

    boolean save(T t);

    boolean save(List<T> values);

    boolean update(T t);
    
    // new methods
    List<T> query(String prepareSQL, Object... parameter);
    
    List<T> query(String prepareSQL);
    
    ResultSet selectResultSet(String prepareSQL);
    
    ResultSet selectResultSet(String prepareSQL, Object... parameter);
    
    // more new methods
    
    T getFirst();
    
    T getLast();
    
}
